package com.sqx.modules.errand.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.errand.entity.ErrandEvaluate;
import com.sqx.modules.errand.service.ErrandEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/apperrandevaluate")
@Api(value = "用户端-评价", tags = {"用户端-评价"})
public class AppErrandEvaluateController {

    @Autowired
    private ErrandEvaluateService errandEvaluateService;

    @Login
    @PostMapping(value = "userEvaluate")
    @ApiOperation("用户评价（评价等级和内容）")
    public Result userEvaluate(@RequestAttribute Long userId, @RequestBody ErrandEvaluate evaluate){

        return errandEvaluateService.userEvaluate(userId, evaluate);
    }

}
